<?php
// 创建连接
$conn = new mysqli("localhost", "root","wei1995629", "information");

// 检测连接
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}

// 预处理及绑定
$stmt = $conn->prepare("INSERT INTO userInformation (userName, email, telNumber, password) VALUES(?, ?, ?,?)");
$stmt->bind_param("ssss",$userName, $email, $telNumber, $password);

// 设置参数并执行
$userName = "{$_POST['userName']}";
$email = "{$_POST['email']}";
$telNumber = "{$_POST['telNumber']}";
$password = "{$_POST['password']}";
$stmt->execute();

$stmt->close();
$conn->close();
include 'index.php';
echo "<script>alert('注册成功！')</script>";

?>










